﻿namespace HRM.CORE
{
    using DevExpress.Utils;
    using DevExpress.XtraBars;
    using DevExpress.XtraEditors;
    using DevExpress.XtraEditors.Controls;
    using APP.HELPER;
    using Common.Class; using APP.HELPER.Utils.Language; using Security.Security; using Dictionary.ERP;
    using Common.Report;
    using HRM.CORE;
    using HRM.CORE.REPORT;
    using System; using Extra.ERP;
    using System.ComponentModel;
    using System.Drawing;
    using System.Windows.Forms; using Common;
    using System.Data;
    using Extra.ERP;
    using Common;

    public class xfmInsurance : XtraForm
    {
        private Bar bar1;
        private BarButtonItem barButtonItem3;
        private BarDockControl barDockControlBottom;
        private BarDockControl barDockControlLeft;
        private BarDockControl barDockControlRight;
        private BarDockControl barDockControlTop;
        private BarManager barManager1;
        private BarSubItem barSubItem1;
        private BarButtonItem bbiAddHealthInsurance;
        private BarButtonItem bbiAddUnemployment;
        private BarButtonItem bbiChangeSalary;
        private BarButtonItem bbiClose;
        private BarButtonItem bbiDecrease;
        private BarButtonItem bbiDelete;
        private BarButtonItem bbiIncrease;
        private BarButtonItem bbiInsurance;
        private BarButtonItem bbiModify;
        private BarButtonItem bbiPrint02aTBH;
        private BarButtonItem bbiPrint03aTBH;
        private BarButtonItem bbiPrint03bTBH;
        private BarButtonItem bbiPrintCreateInsurance;
        private BarButtonItem bbiPrintD02TS;
        private BarButtonItem bbiReload;
        private IContainer components = null;
        private GroupControl gcControl;
        private GroupControl gcLeft;
        public DevExpress.Utils.ImageCollection imageCollection3;
        private Guid m_InsuranceTableListID = Guid.Empty;
        private int m_Month = 0;
        private int m_Type = 0;
        private int m_Year = 0;
        private HRM.CORE.xuc02aTBH xuc02aTBH;
        private HRM.CORE.xuc03aTBH xuc03aTBH;
        private HRM.CORE.xuc03bTBH xuc03bTBH;
        private HRM.CORE.xucCreateInsurance xucCreateInsurance;
        private xucInsurance xucInsurance1;
        private xucSelectEmployees xucSelect;

        public xfmInsurance()
        {
            this.InitializeComponent();
        }

        private void bbiClose_ItemClick(object sender, ItemClickEventArgs e)
        {
            base.Close();
        }

        private void bbiCreateInsurance_ItemClick(object sender, ItemClickEventArgs e)
        {
            this.SetDown(e.Item.Name);
            this.CreateInsurance(e.Item.Name);
        }

        private void bbiDelete_ItemClick(object sender, ItemClickEventArgs e)
        {
            if (this.m_Type == 0)
            {
                this.xucCreateInsurance.Delete();
            }
            else if (this.m_Type == 1)
            {
                this.xuc02aTBH.Delete();
            }
            else if (this.m_Type == 2)
            {
                this.xuc03aTBH.Delete();
            }
            else if (this.m_Type == 3)
            {
                this.xuc03bTBH.Delete();
            }
        }

        private void bbiInsurance_ItemClick(object sender, ItemClickEventArgs e)
        {
            this.SetDown("bbiInsurance");
            if (this.xucSelect != null)
            {
                this.gcLeft.Controls.Remove(this.xucSelect);
                this.xucSelect = null;
            }
        }

        private void bbiPrint_ItemClick(object sender, ItemClickEventArgs e)
        {
            xfmReport report = new xfmReport("Hợp Đồng Lao Động");
            if (e.Item == this.bbiPrintCreateInsurance)
            {
                rptCreateInsurance xtraReport = new rptCreateInsurance(this.m_InsuranceTableListID);
                report.SetTitle("Danh s\x00e1ch lao động ph\x00e1t sinh nghiệp vụ BHXH, BHYT");
                report.ShowPrintPreview(xtraReport);
            }
            else if (e.Item == this.bbiPrint02aTBH)
            {
                rpt02aTBH atbh = new rpt02aTBH(this.m_InsuranceTableListID);
                report.SetTitle("Danh s\x00e1ch lao động tham gia BHXH, BHYT (02a-TBH)");
                report.ShowPrintPreview(atbh);
            }
            else if (e.Item == this.bbiPrint03aTBH)
            {
                rpt03aTBH atbh2 = new rpt03aTBH(this.m_InsuranceTableListID);
                report.SetTitle("Danh s\x00e1ch điều chỉnh lao động v\x00e0 mức đ\x00f3ng BHXH, BHYT (03a-TBH)");
                report.ShowPrintPreview(atbh2);
            }
            else if (e.Item == this.bbiPrint03bTBH)
            {
                rpt03bTBH btbh = new rpt03bTBH(this.m_InsuranceTableListID);
                report.SetTitle("Danh s\x00e1ch đề nghị điều chỉnh hồ sơ tham gia BHXH, BHYT (03b-TBH)");
                report.ShowPrintPreview(btbh);
            }
            else if (e.Item == this.bbiPrintD02TS)
            {
                rptD02TS tdts = new rptD02TS(this.m_InsuranceTableListID);
                report.SetTitle("Danh s\x00e1ch lao động tham gia BHXH, BHYT (D02-TS)");
                report.ShowPrintPreview(tdts);
            }
        }

        private void bbiReload_ItemClick(object sender, ItemClickEventArgs e)
        {
            this.Reload();
        }

        private void CreateInsurance(string item)
        {
            xucSelectEmployees.SelectedEventHander hander = null;
            xucSelectEmployees.SelectedEventHander hander2 = null;
            xucSelectEmployees.SelectedEventHander hander3 = null;
            xucSelectEmployees.SelectedEventHander hander4 = null;
            xucSelectEmployees.SelectedEventHander hander5 = null;
            xucSelectEmployees.SelectedEventHander hander6 = null;
            if (this.xucSelect == null)
            {
                this.xucSelect = new xucSelectEmployees();
                this.xucSelect.Dock = DockStyle.Fill;
                this.gcLeft.Controls.Add(this.xucSelect);
                this.xucSelect.BringToFront();
            }
            switch (item)
            {
                case "bbiIncrease":
                    this.xucSelect.LoadData(1, 1);
                    this.xucSelect.SetTitle("Tăng", "Ph\x00e1t Sinh");
                    if (hander == null)
                    {
                        hander = delegate (object s, DataTable dt) {
                            xfmIncrease increase = new xfmIncrease(dt);
                            increase.Created += se => this.Reload();
                            increase.ShowDialog();
                            this.SetNull();
                        };
                    }
                    this.xucSelect.Selected += hander;
                    break;

                case "bbiDecrease":
                    this.xucSelect.LoadData(0, 1);
                    this.xucSelect.SetTitle("Giảm", "Ph\x00e1t Sinh");
                    if (hander2 == null)
                    {
                        hander2 = delegate (object s, DataTable dt) {
                            xfmDecrease decrease = new xfmDecrease(dt);
                            decrease.Created += se => this.Reload();
                            decrease.ShowDialog();
                            this.SetNull();
                        };
                    }
                    this.xucSelect.Selected += hander2;
                    break;

                case "bbiChangeSalary":
                    this.xucSelect.LoadData(0, 1);
                    this.xucSelect.SetTitle("Điều Chỉnh Lương, Chức Vụ", "Ph\x00e1t Sinh");
                    if (hander3 == null)
                    {
                        hander3 = delegate (object s, DataTable dt) {
                            xfmChangeSalary salary = new xfmChangeSalary(dt);
                            salary.Created += se => this.Reload();
                            salary.ShowDialog();
                            this.SetNull();
                        };
                    }
                    this.xucSelect.Selected += hander3;
                    break;

                case "bbiAddHealthInsurance":
                    this.xucSelect.LoadData(0, 1);
                    this.xucSelect.SetTitle("Bổ Sung BHYT", "Ph\x00e1t Sinh");
                    if (hander4 == null)
                    {
                        hander4 = delegate (object s, DataTable dt) {
                            xfmAddHealthInsurance insurance = new xfmAddHealthInsurance(dt);
                            insurance.Created += se => this.Reload();
                            insurance.ShowDialog();
                            this.SetNull();
                        };
                    }
                    this.xucSelect.Selected += hander4;
                    break;

                case "bbiAddUnemployment":
                    this.xucSelect.LoadData(0, 1);
                    this.xucSelect.SetTitle("Bổ Sung BHTN", "Ph\x00e1t Sinh");
                    if (hander5 == null)
                    {
                        hander5 = delegate (object s, DataTable dt) {
                            xfmAddUnemploymentInsurance insurance = new xfmAddUnemploymentInsurance(dt);
                            insurance.Created += se => this.Reload();
                            insurance.ShowDialog();
                            this.SetNull();
                        };
                    }
                    this.xucSelect.Selected += hander5;
                    break;

                case "bbiModify":
                    this.xucSelect.LoadData(-1, 1);
                    this.xucSelect.SetTitle("Điều Chỉnh Hồ Sơ BHXH, BHYT", "Ph\x00e1t Sinh");
                    if (hander6 == null)
                    {
                        hander6 = delegate (object s, DataTable dt) {
                            new xfmModify(dt).ShowDialog();
                            this.SetNull();
                        };
                    }
                    this.xucSelect.Selected += hander6;
                    break;
            }
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void Execute(string id, string @ref)
        {
            string str = id;
            if (str != null)
            {
                if (!(str == "xucCreateInsurance"))
                {
                    if (str == "xuc02aTBH")
                    {
                        SYS_LOG.Insert("Danh s\x00e1ch lao động tăng (th\x00e1ng " + this.m_Month.ToString() + "/" + this.m_Year.ToString() + ")", "Xem");
                        this.gcControl.Text = "Danh s\x00e1ch lao động tăng (th\x00e1ng " + this.m_Month.ToString() + "/" + this.m_Year.ToString() + ")";
                        if (this.xuc02aTBH == null)
                        {
                            this.xuc02aTBH = new HRM.CORE.xuc02aTBH(this.m_InsuranceTableListID);
                            this.xuc02aTBH.Dock = DockStyle.Fill;
                            this.gcControl.Controls.Add(this.xuc02aTBH);
                            this.xuc02aTBH.BringToFront();
                        }
                        else
                        {
                            this.xuc02aTBH.LoadData(this.m_InsuranceTableListID);
                            this.xuc02aTBH.BringToFront();
                        }
                    }
                    else if (str == "xuc03aTBH")
                    {
                        SYS_LOG.Insert("Danh s\x00e1ch lao động giảm (th\x00e1ng " + this.m_Month.ToString() + "/" + this.m_Year.ToString() + ")", "Xem");
                        this.gcControl.Text = "Danh s\x00e1ch lao động giảm (th\x00e1ng " + this.m_Month.ToString() + "/" + this.m_Year.ToString() + ")";
                        if (this.xuc03aTBH == null)
                        {
                            this.xuc03aTBH = new HRM.CORE.xuc03aTBH(this.m_InsuranceTableListID);
                            this.xuc03aTBH.Dock = DockStyle.Fill;
                            this.gcControl.Controls.Add(this.xuc03aTBH);
                            this.xuc03aTBH.BringToFront();
                        }
                        else
                        {
                            this.xuc03aTBH.LoadData(this.m_InsuranceTableListID);
                            this.xuc03aTBH.BringToFront();
                        }
                    }
                    else if (str == "xuc03bTBH")
                    {
                        SYS_LOG.Insert("Danh s\x00e1ch đề nghị điều chỉnh hồ sơ tham gia BHXH, BHYT (th\x00e1ng " + this.m_Month.ToString() + "/" + this.m_Year.ToString() + ")", "Xem");
                        this.gcControl.Text = "Danh s\x00e1ch đề nghị điều chỉnh hồ sơ tham gia BHXH, BHYT (th\x00e1ng " + this.m_Month.ToString() + "/" + this.m_Year.ToString() + ")";
                        if (this.xuc03bTBH == null)
                        {
                            this.xuc03bTBH = new HRM.CORE.xuc03bTBH(this.m_InsuranceTableListID);
                            this.xuc03bTBH.Dock = DockStyle.Fill;
                            this.gcControl.Controls.Add(this.xuc03bTBH);
                            this.xuc03bTBH.BringToFront();
                        }
                        else
                        {
                            this.xuc03bTBH.LoadData(this.m_InsuranceTableListID);
                            this.xuc03bTBH.BringToFront();
                        }
                    }
                }
                else
                {
                    SYS_LOG.Insert("Danh s\x00e1ch lao động ph\x00e1t sinh nghiệp vụ bảo hiểm (th\x00e1ng " + this.m_Month.ToString() + "/" + this.m_Year.ToString() + ")", "Xem");
                    this.gcControl.Text = "Danh s\x00e1ch lao động ph\x00e1t sinh nghiệp vụ bảo hiểm (th\x00e1ng " + this.m_Month.ToString() + "/" + this.m_Year.ToString() + ")";
                    if (this.xucCreateInsurance == null)
                    {
                        this.xucCreateInsurance = new HRM.CORE.xucCreateInsurance(this.m_InsuranceTableListID);
                        this.xucCreateInsurance.Dock = DockStyle.Fill;
                        this.gcControl.Controls.Add(this.xucCreateInsurance);
                        this.xucCreateInsurance.BringToFront();
                    }
                    else
                    {
                        this.xucCreateInsurance.LoadData(this.m_InsuranceTableListID);
                        this.xucCreateInsurance.BringToFront();
                    }
                }
            }
        }

        private void InitializeComponent()
        {
            this.components = new Container();
            MenuButton button = new MenuButton();
            ItemCommand command = new ItemCommand();
            ItemCommand command2 = new ItemCommand();
            ItemCommand command3 = new ItemCommand();
            ItemCommand command4 = new ItemCommand();
            ItemCommand command5 = new ItemCommand();
            ItemCommand command6 = new ItemCommand();
            ItemCommand command7 = new ItemCommand();
            ItemCommand command8 = new ItemCommand();
            ItemCommand command9 = new ItemCommand();
            ItemCommand command10 = new ItemCommand();
            ItemCommand command11 = new ItemCommand();
            ItemCommand command12 = new ItemCommand();
            ItemCommand command13 = new ItemCommand();
            ItemCommand command14 = new ItemCommand();
            ItemCommand command15 = new ItemCommand();
            ItemCommand command16 = new ItemCommand();
            ItemCommand command17 = new ItemCommand();
            ItemCommand command18 = new ItemCommand();
            ItemCommand command19 = new ItemCommand();
            ItemCommand command20 = new ItemCommand();
            ItemCommand command21 = new ItemCommand();
            ItemCommand command22 = new ItemCommand();
            ItemCommand command23 = new ItemCommand();
            ItemCommand command24 = new ItemCommand();
            ItemCommand command25 = new ItemCommand();
            ItemCommand command26 = new ItemCommand();
            ItemCommand command27 = new ItemCommand();
            ItemCommand command28 = new ItemCommand();
            ItemCommand command29 = new ItemCommand();
            ComponentResourceManager manager = new ComponentResourceManager(typeof(HRM.CORE.xfmInsurance));
            this.gcControl = new GroupControl();
            this.xucInsurance1 = new xucInsurance();
            this.barManager1 = new BarManager(this.components);
            this.bar1 = new Bar();
            this.bbiInsurance = new BarButtonItem();
            this.bbiIncrease = new BarButtonItem();
            this.bbiDecrease = new BarButtonItem();
            this.bbiChangeSalary = new BarButtonItem();
            this.bbiAddHealthInsurance = new BarButtonItem();
            this.bbiAddUnemployment = new BarButtonItem();
            this.bbiModify = new BarButtonItem();
            this.barButtonItem3 = new BarButtonItem();
            this.bbiDelete = new BarButtonItem();
            this.barSubItem1 = new BarSubItem();
            this.bbiPrintCreateInsurance = new BarButtonItem();
            this.bbiPrint02aTBH = new BarButtonItem();
            this.bbiPrint03aTBH = new BarButtonItem();
            this.bbiPrint03bTBH = new BarButtonItem();
            this.bbiPrintD02TS = new BarButtonItem();
            this.bbiReload = new BarButtonItem();
            this.bbiClose = new BarButtonItem();
            this.barDockControlTop = new BarDockControl();
            this.barDockControlBottom = new BarDockControl();
            this.barDockControlLeft = new BarDockControl();
            this.barDockControlRight = new BarDockControl();
            this.imageCollection3 = new DevExpress.Utils.ImageCollection(this.components);
            this.gcLeft = new GroupControl();
            this.gcControl.BeginInit();
            this.barManager1.BeginInit();
            this.imageCollection3.BeginInit();
            this.gcLeft.BeginInit();
            this.gcLeft.SuspendLayout();
            base.SuspendLayout();
            this.gcControl.BorderStyle = BorderStyles.NoBorder;
            this.gcControl.Dock = DockStyle.Fill;
            this.gcControl.Location = new Point(210, 0x1a);
            this.gcControl.Name = "gcControl";
            this.gcControl.Size = new Size(0x3c5, 0x255);
            this.gcControl.TabIndex = 1;
            this.gcControl.Text = "groupControl1";
            this.xucInsurance1.Dock = DockStyle.Fill;
            this.xucInsurance1.IsClose = CloseOrNew.None;
            this.xucInsurance1.Location = new Point(2, 2);
            this.xucInsurance1.Name = "xucInsurance1";
            this.xucInsurance1.NotSave = false;
            command.Caption = "";
            command.Enable = false;
            command.Visibility = BarItemVisibility.Never;
            button.Add = command;
            command2.Caption = "";
            command2.Enable = false;
            command2.Visibility = BarItemVisibility.Never;
            button.Cancel = command2;
            command3.Caption = "";
            command3.Enable = false;
            command3.Visibility = BarItemVisibility.Never;
            button.Change = command3;
            command4.Caption = "";
            command4.Enable = false;
            command4.Visibility = BarItemVisibility.Never;
            button.Close = command4;
            command5.Caption = "";
            command5.Enable = false;
            command5.Visibility = BarItemVisibility.Never;
            button.Custom = command5;
            command6.Caption = "";
            command6.Enable = false;
            command6.Visibility = BarItemVisibility.Never;
            button.Delete = command6;
            command7.Caption = "";
            command7.Enable = false;
            command7.Visibility = BarItemVisibility.Never;
            button.Export = command7;
            command8.Caption = "";
            command8.Enable = false;
            command8.Visibility = BarItemVisibility.Never;
            button.Filter = command8;
            command9.Caption = "";
            command9.Enable = false;
            command9.Visibility = BarItemVisibility.Never;
            button.FilterCustomer = command9;
            command10.Caption = "";
            command10.Enable = false;
            command10.Visibility = BarItemVisibility.Never;
            button.FilterStock = command10;
            command11.Caption = "";
            command11.Enable = false;
            command11.Visibility = BarItemVisibility.Never;
            button.Find = command11;
            button.GClose = false;
            button.GCommand = false;
            button.GExport = false;
            command12.Caption = "";
            command12.Enable = false;
            command12.Visibility = BarItemVisibility.Never;
            button.Go = command12;
            button.GOption = false;
            button.GPrint = false;
            button.GRecords = false;
            button.GSearchBar = false;
            button.GSettings = false;
            button.GVaildation = false;
            command13.Caption = "";
            command13.Enable = false;
            command13.Visibility = BarItemVisibility.Never;
            button.Import = command13;
            command14.Caption = "";
            command14.Enable = false;
            command14.Visibility = BarItemVisibility.Never;
            button.Next = command14;
            command15.Caption = "";
            command15.Enable = false;
            command15.Visibility = BarItemVisibility.Never;
            button.PageSetup = command15;
            button.PHome = false;
            command16.Caption = "";
            command16.Enable = false;
            command16.Visibility = BarItemVisibility.Never;
            button.Previous = command16;
            command17.Caption = "";
            command17.Enable = false;
            command17.Visibility = BarItemVisibility.Never;
            button.Print = command17;
            command18.Caption = "";
            command18.Enable = false;
            command18.Visibility = BarItemVisibility.Never;
            button.PrintPreview = command18;
            button.PTool = false;
            command19.Caption = "";
            command19.Enable = false;
            command19.Visibility = BarItemVisibility.Never;
            button.Redo = command19;
            command20.Caption = "";
            command20.Enable = false;
            command20.Visibility = BarItemVisibility.Never;
            button.Refresh = command20;
            command21.Caption = "";
            command21.Enable = false;
            command21.Visibility = BarItemVisibility.Never;
            button.Save = command21;
            command22.Caption = "";
            command22.Enable = false;
            command22.Visibility = BarItemVisibility.Never;
            button.SaveAndClose = command22;
            command23.Caption = "";
            command23.Enable = false;
            command23.Visibility = BarItemVisibility.Never;
            button.SaveAndNew = command23;
            command24.Caption = "";
            command24.Enable = false;
            command24.Visibility = BarItemVisibility.Never;
            button.Search = command24;
            command25.Caption = "";
            command25.Enable = false;
            command25.Visibility = BarItemVisibility.Never;
            button.SearchText = command25;
            command26.Caption = "";
            command26.Enable = false;
            command26.Visibility = BarItemVisibility.Never;
            button.Task = command26;
            command27.Caption = "";
            command27.Enable = false;
            command27.Visibility = BarItemVisibility.Never;
            button.Undo = command27;
            command28.Caption = "";
            command28.Enable = false;
            command28.Visibility = BarItemVisibility.Never;
            button.Vaildate = command28;
            command29.Caption = "";
            command29.Enable = false;
            command29.Visibility = BarItemVisibility.Never;
            button.View = command29;
            this.xucInsurance1.RibbonBar = button;
            this.xucInsurance1.Size = new Size(0xd0, 0x251);
            this.xucInsurance1.Status = Actions.None;
            this.xucInsurance1.TabIndex = 2;
            this.xucInsurance1.Title = "";
            this.barManager1.Bars.AddRange(new Bar[] { this.bar1 });
            this.barManager1.DockControls.Add(this.barDockControlTop);
            this.barManager1.DockControls.Add(this.barDockControlBottom);
            this.barManager1.DockControls.Add(this.barDockControlLeft);
            this.barManager1.DockControls.Add(this.barDockControlRight);
            this.barManager1.Form = this;
            this.barManager1.Images = this.imageCollection3;
            this.barManager1.Items.AddRange(new BarItem[] { 
                this.bbiInsurance, this.barButtonItem3, this.bbiDelete, this.bbiReload, this.bbiClose, this.bbiIncrease, this.bbiDecrease, this.bbiChangeSalary, this.bbiAddHealthInsurance, this.bbiAddUnemployment, this.bbiModify, this.barSubItem1, this.bbiPrintCreateInsurance, this.bbiPrint02aTBH, this.bbiPrint03aTBH, this.bbiPrint03bTBH, 
                this.bbiPrintD02TS
             });
            this.barManager1.MaxItemId = 0x17;
            this.bar1.BarName = "Custom 3";
            this.bar1.DockCol = 0;
            this.bar1.DockRow = 0;
            this.bar1.DockStyle = BarDockStyle.Top;
            this.bar1.LinksPersistInfo.AddRange(new LinkPersistInfo[] { new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.bbiInsurance, "", true, true, true, 0, null, BarItemPaintStyle.CaptionGlyph), new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.bbiIncrease, "", true, true, true, 0, null, BarItemPaintStyle.CaptionGlyph), new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.bbiDecrease, BarItemPaintStyle.CaptionGlyph), new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.bbiChangeSalary, BarItemPaintStyle.CaptionGlyph), new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.bbiAddHealthInsurance, BarItemPaintStyle.CaptionGlyph), new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.bbiAddUnemployment, BarItemPaintStyle.CaptionGlyph), new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.bbiModify, BarItemPaintStyle.CaptionGlyph), new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.barButtonItem3, "", true, true, true, 0, null, BarItemPaintStyle.CaptionGlyph), new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.bbiDelete, BarItemPaintStyle.CaptionGlyph), new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.barSubItem1, BarItemPaintStyle.CaptionGlyph), new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.bbiReload, "", true, true, true, 0, null, BarItemPaintStyle.CaptionGlyph), new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.bbiClose, BarItemPaintStyle.CaptionGlyph) });
            this.bar1.OptionsBar.UseWholeRow = true;
            this.bar1.Text = "Custom 3";
            this.bbiInsurance.ButtonStyle = BarButtonStyle.Check;
            this.bbiInsurance.Caption = "Đợt B\x00e1o C\x00e1o";
            this.bbiInsurance.Down = true;
            this.bbiInsurance.Id = 0;
            this.bbiInsurance.ImageIndex = 13;
            this.bbiInsurance.Name = "bbiInsurance";
            this.bbiInsurance.ItemClick += new ItemClickEventHandler(this.bbiInsurance_ItemClick);
            this.bbiIncrease.ButtonStyle = BarButtonStyle.Check;
            this.bbiIncrease.Caption = "Tăng";
            this.bbiIncrease.Id = 8;
            this.bbiIncrease.ImageIndex = 3;
            this.bbiIncrease.Name = "bbiIncrease";
            this.bbiIncrease.ItemClick += new ItemClickEventHandler(this.bbiCreateInsurance_ItemClick);
            this.bbiDecrease.ButtonStyle = BarButtonStyle.Check;
            this.bbiDecrease.Caption = "Giảm";
            this.bbiDecrease.Id = 9;
            this.bbiDecrease.ImageIndex = 9;
            this.bbiDecrease.Name = "bbiDecrease";
            this.bbiDecrease.ItemClick += new ItemClickEventHandler(this.bbiCreateInsurance_ItemClick);
            this.bbiChangeSalary.ButtonStyle = BarButtonStyle.Check;
            this.bbiChangeSalary.Caption = "Điều Chỉnh Lương";
            this.bbiChangeSalary.Id = 10;
            this.bbiChangeSalary.ImageIndex = 6;
            this.bbiChangeSalary.Name = "bbiChangeSalary";
            this.bbiChangeSalary.ItemClick += new ItemClickEventHandler(this.bbiCreateInsurance_ItemClick);
            this.bbiAddHealthInsurance.ButtonStyle = BarButtonStyle.Check;
            this.bbiAddHealthInsurance.Caption = "Bổ Sung BHYT";
            this.bbiAddHealthInsurance.Id = 11;
            this.bbiAddHealthInsurance.ImageIndex = 5;
            this.bbiAddHealthInsurance.Name = "bbiAddHealthInsurance";
            this.bbiAddHealthInsurance.ItemClick += new ItemClickEventHandler(this.bbiCreateInsurance_ItemClick);
            this.bbiAddUnemployment.ButtonStyle = BarButtonStyle.Check;
            this.bbiAddUnemployment.Caption = "Bổ Sung BHTN";
            this.bbiAddUnemployment.Id = 12;
            this.bbiAddUnemployment.ImageIndex = 4;
            this.bbiAddUnemployment.Name = "bbiAddUnemployment";
            this.bbiAddUnemployment.ItemClick += new ItemClickEventHandler(this.bbiCreateInsurance_ItemClick);
            this.bbiModify.ButtonStyle = BarButtonStyle.Check;
            this.bbiModify.Caption = "Điều Chỉnh Hồ Sơ BHXH, BHYT";
            this.bbiModify.Id = 13;
            this.bbiModify.ImageIndex = 7;
            this.bbiModify.Name = "bbiModify";
            this.bbiModify.ItemClick += new ItemClickEventHandler(this.bbiCreateInsurance_ItemClick);
            this.barButtonItem3.Caption = "Sửa Chữa";
            this.barButtonItem3.Id = 2;
            this.barButtonItem3.ImageIndex = 12;
            this.barButtonItem3.Name = "barButtonItem3";
            this.barButtonItem3.Visibility = BarItemVisibility.Never;
            this.bbiDelete.Caption = "X\x00f3a";
            this.bbiDelete.Id = 3;
            this.bbiDelete.ImageIndex = 11;
            this.bbiDelete.Name = "bbiDelete";
            this.bbiDelete.ItemClick += new ItemClickEventHandler(this.bbiDelete_ItemClick);
            this.barSubItem1.Caption = "In";
            this.barSubItem1.Id = 15;
            this.barSubItem1.ImageIndex = 0;
            this.barSubItem1.LinksPersistInfo.AddRange(new LinkPersistInfo[] { new LinkPersistInfo(this.bbiPrintCreateInsurance), new LinkPersistInfo(this.bbiPrint02aTBH, true), new LinkPersistInfo(this.bbiPrint03aTBH), new LinkPersistInfo(this.bbiPrint03bTBH), new LinkPersistInfo(this.bbiPrintD02TS, true) });
            this.barSubItem1.Name = "barSubItem1";
            this.bbiPrintCreateInsurance.Caption = "Danh S\x00e1ch Lao Động Ph\x00e1t Sinh Nghiệp Vụ BHXH, BHYT Trong Đợt";
            this.bbiPrintCreateInsurance.Id = 0x10;
            this.bbiPrintCreateInsurance.Name = "bbiPrintCreateInsurance";
            this.bbiPrintCreateInsurance.ItemClick += new ItemClickEventHandler(this.bbiPrint_ItemClick);
            this.bbiPrint02aTBH.Caption = "Danh S\x00e1ch Lao Động Tham Gia BHXH, BHYT Bắt Buộc (Mấu Số 02a-TBH)";
            this.bbiPrint02aTBH.Id = 0x11;
            this.bbiPrint02aTBH.ImageIndex = 14;
            this.bbiPrint02aTBH.Name = "bbiPrint02aTBH";
            this.bbiPrint02aTBH.ItemClick += new ItemClickEventHandler(this.bbiPrint_ItemClick);
            this.bbiPrint03aTBH.Caption = "Danh S\x00e1ch Điều Chỉnh Lao Động V\x00e0 Mức Đ\x00f3ng BHXH, BHYT (Mấu Số 03a-TBH)";
            this.bbiPrint03aTBH.Id = 0x12;
            this.bbiPrint03aTBH.ImageIndex = 15;
            this.bbiPrint03aTBH.Name = "bbiPrint03aTBH";
            this.bbiPrint03aTBH.ItemClick += new ItemClickEventHandler(this.bbiPrint_ItemClick);
            this.bbiPrint03bTBH.Caption = "Danh S\x00e1ch Đề Nghị Điều Chỉnh Hồ Sơ Tham Gia BHXH, BHYT (Mẫu Số 03b-TBH)";
            this.bbiPrint03bTBH.Id = 0x13;
            this.bbiPrint03bTBH.ImageIndex = 0x10;
            this.bbiPrint03bTBH.Name = "bbiPrint03bTBH";
            this.bbiPrint03bTBH.ItemClick += new ItemClickEventHandler(this.bbiPrint_ItemClick);
            this.bbiPrintD02TS.Caption = "Danh S\x00e1ch Lao Động Tham Gia BHXH, BHYT Bắt Buộc (Mẫu Số D02-TS)";
            this.bbiPrintD02TS.Id = 0x16;
            this.bbiPrintD02TS.Name = "bbiPrintD02TS";
            this.bbiPrintD02TS.ItemClick += new ItemClickEventHandler(this.bbiPrint_ItemClick);
            this.bbiReload.Caption = "Nạp Lại";
            this.bbiReload.Id = 6;
            this.bbiReload.ImageIndex = 10;
            this.bbiReload.Name = "bbiReload";
            this.bbiReload.ItemClick += new ItemClickEventHandler(this.bbiReload_ItemClick);
            this.bbiClose.Caption = "Đ\x00f3ng";
            this.bbiClose.Id = 7;
            this.bbiClose.ImageIndex = 2;
            this.bbiClose.Name = "bbiClose";
            this.bbiClose.ItemClick += new ItemClickEventHandler(this.bbiClose_ItemClick);
            this.imageCollection3.ImageStream = (ImageCollectionStreamer) manager.GetObject("imageCollection3.ImageStream");
            this.imageCollection3.Images.SetKeyName(3, "chart_up_color.png");
            this.imageCollection3.Images.SetKeyName(4, "folder_import.png");
            this.imageCollection3.Images.SetKeyName(5, "import.png");
            this.imageCollection3.Images.SetKeyName(6, "line_chart.png");
            this.imageCollection3.Images.SetKeyName(7, "stock_modify_layout.png");
            this.imageCollection3.Images.SetKeyName(8, "download_green.png");
            this.imageCollection3.Images.SetKeyName(9, "move_waiting_down.png");
            this.imageCollection3.Images.SetKeyName(10, "reload16x16.png");
            this.imageCollection3.Images.SetKeyName(11, "delete.png");
            this.imageCollection3.Images.SetKeyName(12, "edit.png");
            this.imageCollection3.Images.SetKeyName(13, "arrow_large_up.png");
            this.imageCollection3.Images.SetKeyName(14, "02a.png");
            this.imageCollection3.Images.SetKeyName(15, "03a.png");
            this.imageCollection3.Images.SetKeyName(0x10, "03b.png");
            this.gcLeft.BorderStyle = BorderStyles.NoBorder;
            this.gcLeft.Controls.Add(this.xucInsurance1);
            this.gcLeft.Dock = DockStyle.Left;
            this.gcLeft.Location = new Point(0, 0x1a);
            this.gcLeft.Name = "gcLeft";
            this.gcLeft.Padding = new Padding(2, 2, 0, 2);
            this.gcLeft.Size = new Size(210, 0x255);
            this.gcLeft.TabIndex = 4;
            this.gcLeft.Text = "groupControl1";
            base.AutoScaleDimensions = new SizeF(6f, 13f);
            base.AutoScaleMode = AutoScaleMode.Font;
            base.ClientSize = new Size(0x497, 0x26f);
            base.Controls.Add(this.gcControl);
            base.Controls.Add(this.gcLeft);
            base.Controls.Add(this.barDockControlLeft);
            base.Controls.Add(this.barDockControlRight);
            base.Controls.Add(this.barDockControlBottom);
            base.Controls.Add(this.barDockControlTop);
            base.Name = "xfmInsurance";
            this.Text = "C\x00e1c Đợt B\x00e1o C\x00e1o BHXH, BHYT";
            base.Load += new EventHandler(this.xfmInsurance_Load);
            this.gcControl.EndInit();
            this.barManager1.EndInit();
            this.imageCollection3.EndInit();
            this.gcLeft.EndInit();
            this.gcLeft.ResumeLayout(false);
            base.ResumeLayout(false);
        }

        private void Reload()
        {
            if (this.m_Type == 0)
            {
                this.xucCreateInsurance.ReLoad();
            }
            else if (this.m_Type == 1)
            {
                this.xuc02aTBH.LoadData(this.m_InsuranceTableListID);
            }
            else if (this.m_Type == 2)
            {
                this.xuc03aTBH.LoadData(this.m_InsuranceTableListID);
            }
            else if (this.m_Type == 3)
            {
                this.xuc03bTBH.ReLoad();
            }
        }

        private void SetDown(string item)
        {
            this.bbiInsurance.Down = false;
            this.bbiIncrease.Down = false;
            this.bbiDecrease.Down = false;
            this.bbiChangeSalary.Down = false;
            this.bbiAddHealthInsurance.Down = false;
            this.bbiAddUnemployment.Down = false;
            this.bbiModify.Down = false;
            switch (item)
            {
                case "bbiInsurance":
                    this.bbiInsurance.Down = true;
                    break;

                case "bbiIncrease":
                    this.bbiIncrease.Down = true;
                    break;

                case "bbiDecrease":
                    this.bbiDecrease.Down = true;
                    break;

                case "bbiChangeSalary":
                    this.bbiChangeSalary.Down = true;
                    break;

                case "bbiAddHealthInsurance":
                    this.bbiAddHealthInsurance.Down = true;
                    break;

                case "bbiAddUnemployment":
                    this.bbiAddUnemployment.Down = true;
                    break;

                case "bbiModify":
                    this.bbiModify.Down = true;
                    break;
            }
        }

        private void SetNull()
        {
            this.SetDown("bbiInsurance");
            this.gcLeft.Controls.Remove(this.xucSelect);
            this.xucSelect = null;
        }

        private void xfmInsurance_Load(object sender, EventArgs e)
        {
            this.Execute("xucCreateInsurance", "");
            this.xucInsurance1.Selected += new xucInsurance.SelectedEventHander(this.xucInsurance1_Selected);
            this.xucInsurance1.LoadData();
        }

        private void xucInsurance1_Selected(object sender, Insurance Item)
        {
            this.m_InsuranceTableListID = Item.InsuranceTableListID;
            HRM_INSURANCE_TABLELIST hrm_insurance_tablelist = new HRM_INSURANCE_TABLELIST();
            hrm_insurance_tablelist.Get(this.m_InsuranceTableListID);
            this.m_Month = hrm_insurance_tablelist.Month;
            this.m_Year = hrm_insurance_tablelist.Year;
            if (Item.Type == 0)
            {
                this.m_Type = 0;
                this.Execute("xucCreateInsurance", "");
            }
            else if (Item.Type == 1)
            {
                this.m_Type = 1;
                this.Execute("xuc02aTBH", "");
            }
            else if (Item.Type == 2)
            {
                this.m_Type = 2;
                this.Execute("xuc03aTBH", "");
            }
            else if (Item.Type == 3)
            {
                this.m_Type = 3;
                this.Execute("xuc03bTBH", "");
            }
        }
    }
}

